<?php use_stylesheet('main.css') ?>
<?php use_helper('Text') ?>

<?php  if(isset($current_user)){ ?>

<?php use_helper('Text') ?>

<h1> Articles Publiés</h1>
<?php foreach ($blog_articles as $i => $articleresult): ?>

<?php if ($articleresult->getIsActivated() == true && $articleresult->getPubliedAt() <= date('Y-m-d') ) {?>


<h2><?php echo link_to($articleresult->getTitle(), 'show_articlestoken', $articleresult) ?> </h2><small>Publié le <?php echo $articleresult->getDateTimeObject('publied_at')->format('d/m/Y') ?> par <?php echo $articleresult->getSfGuardUser()->getUserName() ?> dans <?php /*echo link_to($article, 'categories', $article) */  ?> </small>

<p> <?php echo simple_format_text(parseto($articleresult->getRawValue()->getContent())) ?>  </p>


<?php  } endforeach; ?>

 <h1> Articles en attente de publication</h1>
<?php foreach ($blog_articles as $i => $articleresult): ?>

<?php if ($articleresult->getIsActivated() == false OR $articleresult->getPubliedAt() > date('Y-m-d') ) {?>


<h2><?php echo link_to($articleresult->getTitle(), 'show_articlestoken', $articleresult) ?> </h2><small>Publié le <?php echo $articleresult->getDateTimeObject('created_at')->format('d/m/Y') ?> par <?php echo $articleresult->getSfGuardUser()->getUserName() ?> dans <?php /*echo link_to($article, 'categories', $article) */  ?> </small>

<p> <?php echo $articleresult->getRawValue()->getContent() ?> </p>


<?php  } endforeach; ?>
 

<?php  } ?>
